﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PersonaLibrary.Converters
{
    class JobHeaderConverter : System.Windows.Data.IValueConverter
    {
        public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Data.ConnectionJobEmplDep connection = ((System.Windows.Data.CollectionViewGroup)value).Items[0] as Data.ConnectionJobEmplDep;
            if(connection == null) throw new NullReferenceException();
            
            return connection.Department.Organization.Name;
        }

        public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
